<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>echarts</title>
    <style>
      .container {
        width: 800px;
        height: 400px;
      }
    </style>
  </head>
  <body>
    <div class="container"></div>
    <script src="./echarts.min.js"></script>
    <script>
      const myEcharts = echarts.init(document.querySelector(".container"));
      const option = {
        xAxis: { type: "category" },
        yAxis: {},
        dataset: {
          source: [
            ["一月", 20, 30, "xx", 10],
            ["二月", 25, 35, "yy", 20],
            ["三月", 18, 28, "zz", 30],
            ["四月", 30, 40],
            ["五月", 10, 20],
            ["六月", 20, 30],
            ["七月", 25, 35],
            ["八月", 18, 18],
            ["九月", 30, 40],
            ["十月", 10, 20],
            ["十一月", 22, 32],
            ["十二月", 33, 43],
          ],
        },
        series: [
          {
            type: "bar",
            encode: { x: 0, y: 1 },
          },
          {
            type: "line",
            encode: { x: 0, y: 2 },
          },
          {
            type: "pie",
            radius: ["0", "20%"], // 半径
            center: ["70%", "12%"], // 圆心点坐标
            encode: { itemName: 3, value: 4 },
          },
        ],
      };
      myEcharts.setOption(option);
    </script>
  </body>
</html>
